﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<Pulog.Controllers.PostFormViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>编辑文章</legend>
            <p>
                <label><%="Post ID:" + Model.Post.postID %></label>
                <label><%="Author:" + Model.Post.User.userName %></label>
                <%--<%= Html.Hidden("hidpostID",Model.Post.postID) %>--%>
                <%--<%= Html.TextBox("postID", Model.Post.postID) %>--%>
                <%--<%= Html.ValidationMessage("postID", "*") %>--%>
            </p>
            <p>
                <label for="title">Title:</label>
                <%= Html.TextBox("title", Model.Post.title) %>
                <%= Html.ValidationMessage("title", "*") %>
            </p>
            <p>
                <label for="pubTime">发布时间:</label>
                <%= Html.TextBox("pubTime", String.Format("{0:g}", Model.Post.pubTime)) %>
                <%= Html.ValidationMessage("pubTime", "*") %>
            </p>
            <%--<p>
                <label for="authorID">Author ID:</label>
                <%= Html.TextBox("authorID", Model.Post.User.userName) %>
                <%= Html.ValidationMessage("authorID", "*") %>
            </p>--%>
            <p>
                <label for="views">Views:</label>
                <%= Html.TextBox("views", Model.Post.views) %>
                <%= Html.ValidationMessage("views", "*") %>
            </p>
            <p>
                <label for="property">Property:</label>
                <%= Html.DropDownList("property",Model.DropDownListProperties) %>
                <%--<%= Html.TextBox("property", Model.Post.property) %>--%>
                <%= Html.ValidationMessage("property", "*") %>
            </p>
            <p>
                <label for="categoryID">Category:</label>
                <%= Html.DropDownList("categoryID", Model.DropDownListCategories) %>
                <%= Html.ValidationMessage("categoryID", "*") %>
            </p>
            <p>
                <label for="sticky">置顶:</label>
                <%= Html.DropDownList("sticky", Model.DropDownListSticky) %>
                <%--<%= Html.TextBox("sticky", Model.Post.sticky) %>--%>
                <%= Html.ValidationMessage("sticky", "*") %>
            </p>
            <p>
                <label for="password">Password:</label>
                <%= Html.TextBox("password", Model.Post.password) %>
                <%= Html.ValidationMessage("password", "*") %>
            </p>
            <p>
                <label for="slug">Slug:</label>
                <%= Html.TextBox("slug", Model.Post.slug) %>
                <%= Html.ValidationMessage("slug", "*") %>
            </p>
            <%--<p>
                <label for="slug">Tags:</label>
                <%= Html.TextBox("Tags",Model.Post.Tags) %>
                <%= Html.ValidationMessage("Tags", "*") %>
            </p>--%>
            <p>
                <label for="content">内容:</label>
                <%= Html.TextArea("content", Model.Post.content, new { style = "width:800px;height:600px;" })%>
                <%= Html.ValidationMessage("content", "*") %>
            </p>
            <%--<label>Body<br /></label> 
	        <textarea name="content" cols="10" rows="10" style="width:800px;height:600px;" ><%=Model.Post.content %></textarea>--%>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="../../Content/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        mode: "textareas",
        theme: "advanced",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,
        relative_urls: false,
        plugins: "syntaxhl",
        extended_valid_elements: "iframe[src|width|height|name|align]",
        // Theme options
        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,syntaxhl"
    });
</script>

</asp:Content>

